import { defineStore } from 'pinia'

export const useStore = defineStore('index',
  {
    state: () => ({
      shophistory:[],//商城历史搜索
      shopnum:0,//购物车数量
      shopcar:[],//购物车商品列表
      caihistory:[],
      immediatelybuy:[],//购物结算列表
      follow:[],
      address:[],//收货地址
      search:'',
      comment: [//评论
        {
          n: "花枝招展的马郁兰",
          p: "http://i1.douguo.net/upload/photo/1/1/1/70_a5f8400664052cdd91d1ad457d121e16.png",
          city: "威海市",
          lvl: 1,
          good: 12,
          content: "土豆捞出不用放凉水么",
          bool: false
        },
        {
          n: "滋润的西梅很浑浊",
          p: "http://i1.douguo.net/upload/photo/1/1/1/70_004976861ec13b4af62b1d8db8c5c9f7.png",
          city: "扬州市",
          lvl: 2,
          good: 56,
          content: "下午看的我都饿了，早餐又有新吃法了",
          bool: false
        },
        {
          n: "杨益爱詹梦玲",
          p: "http://i1.douguo.net/upload/photo/f/3/8/70_u22546342328450409003004.jpg",
          city: "宁波市",
          lvl: 3,
          good: 9,
          content: "什么面粉都可以嘛",
          bool: false
        },
      ],
      search_history: [//搜索历史
        '番茄',
        '土豆饼',
        '炒饭'
      ],
      scrolltop:"",
      order:[],//订单
      noorder:[],//不结算
      delivergoods:[],//发货
      evaluated:[],//评价
      mycomment:[],//我的评价
      person: {//用户发布
        "result": {
          "recipe": {
            "cook_id": "",
            "as": 2,
            "title": "",
            "photo_path": "https://i1.douguo.com/upload/caiku/4/8/b/960_480ba55758b3e1bb32ca1b551027cefb.jpeg",
            "tips": "",
            "cookstory": "",
            "cookstep": [
              {
                "position": 1,
                "content": "1.准备好食材，番茄要选熟透的番茄，这样炒出来的才好吃。",
                "thumb": "https://i1.douguo.com/upload/caiku/a/7/1/140_a745cb5abd1f16e300842556abf5e9a1.jpeg",
                "image_width": 1280,
                "image_height": 850,
                "image": "https://i1.douguo.com/upload/caiku/a/7/1/800_a745cb5abd1f16e300842556abf5e9a1.jpeg",
                "step_content": [
                  {
                    "is_keyword": false,
                    "name": "1.准备好食材，番茄要选熟透的番茄，这样炒出来的才好吃。"
                  }
                ]
              },
              {
                "position": 2,
                "content": "2.鸡蛋打散，放入1克盐提味儿，少许白醋去腥。",
                "thumb": "https://i1.douguo.com/upload/caiku/0/c/e/140_0cfd14b82e68ebf8c1e4f27632d5130e.jpeg",
                "image_width": 1280,
                "image_height": 850,
                "image": "https://i1.douguo.com/upload/caiku/0/c/e/800_0cfd14b82e68ebf8c1e4f27632d5130e.jpeg",
                "step_content": [
                  {
                    "is_keyword": false,
                    "name": "2.鸡蛋打散，放入1克盐提味儿，少许白醋去腥。"
                  }
                ]
              },
              {
                "position": 3,
                "content": "3.锅中多放点油，待油加热至冒烟后，放入鸡蛋炒至定型。",
                "thumb": "https://i1.douguo.com/upload/caiku/3/3/e/140_3376933ac840b199e7806ebefd0aa3ae.jpeg",
                "image_width": 1280,
                "image_height": 850,
                "image": "https://i1.douguo.com/upload/caiku/3/3/e/800_3376933ac840b199e7806ebefd0aa3ae.jpeg",
                "step_content": [
                  {
                    "is_keyword": false,
                    "name": "3.锅中多放点油，待油加热至冒烟后，放入鸡蛋炒至定型。"
                  }
                ]
              },
              {
                "position": 4,
                "content": "4.鸡蛋取出，西红柿取1/4切丁，剩下的切块。",
                "thumb": "https://i1.douguo.com/upload/caiku/3/7/8/140_37713bb3362a697b176f0fb2da2acd08.jpeg",
                "image_width": 1280,
                "image_height": 850,
                "image": "https://i1.douguo.com/upload/caiku/3/7/8/800_37713bb3362a697b176f0fb2da2acd08.jpeg",
                "step_content": [
                  {
                    "is_keyword": false,
                    "name": "4.鸡蛋取出，西红柿取1/4切丁，剩下的切块。"
                  }
                ]
              },
              {
                "position": 5,
                "content": "5.先将锅中剩余的油加热，放入西红柿丁翻炒，炒的时候用刀背按一下，熬至出蓉。",
                "thumb": "https://i1.douguo.com/upload/caiku/d/6/3/140_d67e3637a5e7cb05dd3bf1ae6f803a53.jpeg",
                "image_width": 1280,
                "image_height": 850,
                "image": "https://i1.douguo.com/upload/caiku/d/6/3/800_d67e3637a5e7cb05dd3bf1ae6f803a53.jpeg",
                "step_content": [
                  {
                    "is_keyword": false,
                    "name": "5.先将锅中剩余的油加热，放入西红柿丁翻炒，炒的时候用刀背按一下，熬至出蓉。"
                  }
                ]
              },
              {
                "position": 6,
                "content": "6.再放入剩下的西红柿块，简单翻炒一下，倒入少许清水。",
                "thumb": "https://i1.douguo.com/upload/caiku/8/4/c/140_847f4eadcf7e3ffb3b25a8aaa0b7329c.jpeg",
                "image_width": 1280,
                "image_height": 850,
                "image": "https://i1.douguo.com/upload/caiku/8/4/c/800_847f4eadcf7e3ffb3b25a8aaa0b7329c.jpeg",
                "step_content": [
                  {
                    "is_keyword": false,
                    "name": "6.再放入剩下的西红柿块，简单翻炒一下，倒入少许清水。"
                  }
                ]
              },
              {
                "position": 7,
                "content": "7.炖煮西红柿的时候，放入1-2克盐，2克糖。",
                "thumb": "https://i1.douguo.com/upload/caiku/c/0/a/140_c0f5712d5c8a4a9628c33b962ffb0eaa.jpeg",
                "image_width": 1280,
                "image_height": 850,
                "image": "https://i1.douguo.com/upload/caiku/c/0/a/800_c0f5712d5c8a4a9628c33b962ffb0eaa.jpeg",
                "step_content": [
                  {
                    "is_keyword": false,
                    "name": "7.炖煮西红柿的时候，放入1-2克盐，2克糖。"
                  }
                ]
              },
              {
                "position": 8,
                "content": "8.炖煮一会儿后，放入鸡蛋翻炒，稍微炖煮一会儿后就可以出锅了。",
                "thumb": "https://i1.douguo.com/upload/caiku/1/f/6/140_1f1bfd4f3d733c2f05e553c275d75ba6.jpeg",
                "image_width": 1280,
                "image_height": 850,
                "image": "https://i1.douguo.com/upload/caiku/1/f/6/800_1f1bfd4f3d733c2f05e553c275d75ba6.jpeg",
                "step_content": [
                  {
                    "is_keyword": false,
                    "name": "8.炖煮一会儿后，放入鸡蛋翻炒，稍微炖煮一会儿后就可以出锅了。"
                  }
                ]
              },
              {
                "position": 9,
                "content": "9.出锅前撒上一把葱花提味。",
                "thumb": "https://i1.douguo.com/upload/caiku/4/3/6/140_438c7f908a75396c5d6e73a53b230426.jpeg",
                "image_width": 1280,
                "image_height": 850,
                "image": "https://i1.douguo.com/upload/caiku/4/3/6/800_438c7f908a75396c5d6e73a53b230426.jpeg",
                "step_content": [
                  {
                    "is_keyword": false,
                    "name": "9.出锅前撒上一把葱花提味。"
                  }
                ]
              },
              {
                "position": 10,
                "content": "10.拌米饭炒鸡好吃，大家试试吧。",
                "thumb": "https://i1.douguo.com/upload/caiku/e/7/e/140_e73eb0abe64513e3ff9a95e684f2c74e.jpeg",
                "image_width": 1280,
                "image_height": 850,
                "image": "https://i1.douguo.com/upload/caiku/e/7/e/800_e73eb0abe64513e3ff9a95e684f2c74e.jpeg",
                "step_content": [
                  {
                    "is_keyword": false,
                    "name": "10.拌米饭炒鸡好吃，大家试试吧。"
                  }
                ]
              }
            ],
            "cook_time": "",
            "cook_difficulty": "切墩(初级)",
            "major": [
              {
                "title": "西红柿",
                "note": "2个",
                "tu": "https://m.douguo.com/ingredients/西红柿/detailmaterial",
                "major_name": [
                  {
                    "is_keyword": false,
                    "name": "西红柿"
                  }
                ]
              },
              {
                "title": "鸡蛋",
                "note": "3个",
                "tu": "https://m.douguo.com/ingredients/鸡蛋/detailmaterial",
                "major_name": [
                  {
                    "is_keyword": false,
                    "name": "鸡蛋"
                  }
                ]
              },
              {
                "title": "盐",
                "note": "2克",
                "tu": "https://m.douguo.com/ingredients/盐/detailmaterial",
                "major_name": [
                  {
                    "is_keyword": false,
                    "name": "盐"
                  }
                ]
              },
              {
                "title": "小葱",
                "note": "少许",
                "tu": "https://m.douguo.com/ingredients/小葱/detailmaterial",
                "major_name": [
                  {
                    "is_keyword": false,
                    "name": "小葱"
                  }
                ]
              }
            ],
            "minor": [],
            "create_time": "2019-08-23 14:49:21",
            "ecs": 0,
            "hq": 1,
            "cook_difficulty_text": "初级",
            "cook_difficulty_image": "https://i1.douguo.com/upload/note/1/8/d/18516d0904b76e46d2804aede541477d.png",
            "vfurl": "",
            "pw": 1920,
            "ph": 1276,
            "pvurl": "",
            "release_time": "发布于 2019-08-23",
            "nutrition_facts": [
              {
                "nutrient": "脂肪",
                "calorie": 234,
                "amount": "26 克",
                "pie_chart_color": "#E2483C"
              },
              {
                "nutrient": "蛋白质",
                "calorie": 168,
                "amount": "42 克",
                "pie_chart_color": "#488040"
              },
              {
                "nutrient": "碳水化合物",
                "calorie": 72,
                "amount": "18 克",
                "pie_chart_color": "#FECD4A"
              }
            ],
            "energy": 465,
            "nutrition_facts_url": "https://m.douguo.com/recipe/nutrient_self_new/754876?at=%E8%BF%99%E9%81%93%E8%8F%9C%E4%BD%8E%E7%B3%96%2C%E8%83%BD%E5%B8%AE%E5%8A%A9%E4%BD%A0%E5%87%8F%E8%84%82%E3%80%81%E6%8E%A7%E8%A1%80%E7%B3%96%EF%BD%9E",
            "nutrition_facts_hint_text": "这道菜低糖,能帮助你减脂、控血糖～点击了解更多健康知识！",
            "nutrition_facts_hint_text_url": "https://h5.baike.qq.com/mobile/home.html?VNK=4e011210&adtag=dgms.yy",
            "share_info": {
              "name": "西红柿炒鸡蛋·最经典易学的下饭料理-会做饭很酷!",
              "object_id": "754876",
              "s_d": "西红柿炒鸡蛋·最经典易学的下饭料理-会做饭很酷!",
              "s_u": "https://m.douguo.com/cookbook/754876.html?usc=",
              "image": "http://i1.douguo.net/upload/caiku/4/8/b/480ba55758b3e1bb32ca1b551027cefb.jpeg",
              "qr_image": "",
              "mini_program": [],
              "infos": [
                {
                  "name": "西红柿炒鸡蛋·最经典易学的下饭料理-会做饭很酷!",
                  "object_id": "754876",
                  "s_d": "西红柿炒鸡蛋·最经典易学的下饭料理-会做饭很酷!",
                  "s_u": "https://m.douguo.com/cookbook/754876.html?usc=",
                  "image": "http://i1.douguo.net/upload/caiku/4/8/b/480ba55758b3e1bb32ca1b551027cefb.jpeg",
                  "qr_image": "",
                  "mini_program": [],
                  "channel": "1"
                },
                {
                  "name": "西红柿炒鸡蛋·最经典易学的下饭料理-会做饭很酷!",
                  "object_id": "754876",
                  "s_d": "西红柿炒鸡蛋·最经典易学的下饭料理-会做饭很酷!",
                  "s_u": "https://m.douguo.com/cookbook/754876.html?usc=",
                  "image": "http://i1.douguo.net/upload/caiku/4/8/b/480ba55758b3e1bb32ca1b551027cefb.jpeg",
                  "qr_image": "",
                  "mini_program": [],
                  "channel": "7"
                },
                {
                  "name": "西红柿炒鸡蛋·最经典易学的下饭料理-会做饭很酷!",
                  "object_id": "754876",
                  "s_d": "西红柿炒鸡蛋·最经典易学的下饭料理-会做饭很酷!",
                  "s_u": "https://m.douguo.com/cookbook/754876.html?usc=",
                  "image": "http://i1.douguo.net/upload/caiku/4/8/b/480ba55758b3e1bb32ca1b551027cefb.jpeg",
                  "qr_image": "",
                  "mini_program": [],
                  "channel": "8"
                }
              ]
            },
            "collect_status": 0,
            "comments_count": 0,
            "favo_counts": 195913,
            "dish_count": 0,
            "vc": 50671152,
            "favo_counts_text": "19.6万",
            "views_count_text": "5067.1万",
            "dish_count_text": 0,
            "cookwares": [],
            "recipe_list_tags": [],
            "recipe_tags": [
              {
                "index": 3,
                "text": "荣誉殿堂",
                "text_color": "#413C32",
                "background_start_color": "#FAE9CD",
                "background_end_color": "#F5D39F",
                "background_border_color": "",
                "right_image": "https://i1.douguo.com/upload/caiku/0/a/b/0a317d98c713e7e7d0d47ed003f2d93b.png",
                "jump_url": "https://m.douguo.com/activity/page/xuezuo?isapp=1&type=honor"
              },
              {
                "index": 114,
                "text": "千人学做",
                "text_color": "#413C32",
                "background_start_color": "#FAE9CD",
                "background_end_color": "#F5D39F",
                "background_border_color": "",
                "right_image": "https://i1.douguo.com/upload/caiku/0/a/b/0a317d98c713e7e7d0d47ed003f2d93b.png",
                "jump_url": "https://m.douguo.com/activity/page/xuezuo?isapp=1&type=klearn"
              }
            ],
            "comments_preceded": 1,
            "cook_tags": [],
            "editable": 0,
            "review_state_text": "",
            "user": {
              "user_id": 15920396,
              "nick": "AABC",
              "nickname": "AABC",
              "user_photo": "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.duoziwang.com%2F2016%2F11%2F25%2F14344097442.jpg&refer=http%3A%2F%2Fimg.duoziwang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1672717464&t=ad9f5c8df5c1be16f2d9d0cc075514c7",
              "avatar_medium": "http://tx1.douguo.net/upload/photo/f/6/4/140_u50522343258515000810.jpeg",
              "verified": 1,
              "lvl": 1,
              "is_prime": false,
              "verified_image": "https://i1.douguo.com/upload/note/d/a/a/da84247847aebe48d9dd0fcdac88862a.png",
              "relationship": -1
            },
            "packages_id": [],
            "cook_time_image": "https://i1.douguo.com/upload/note/a/c/3/acc2dde3b367bfff7fe086d45077b7a3.png"
          }
        }
      },
      wite:{
        src:'',
        tit:''
      }
    }),
  

    persist:{
      enabled: true,//这个配置代表存储生效，而且是整个store都存储
      storage: sessionStorage,
      // strategies:[
      //       {storage: sessionStorage,paths: ['books','user']},// 字段用sessionStorage存储
      //       {storage: localstorage,paths: ['libers']},// 字段用 localstorage存储
      // ],
    }

  })
